import os
import multiprocessing
import time


def func():
    print('这是子进程')
    print('当前子进程号', os.getpid())
    print('它的父进程号', os.getppid())
    time.sleep(20)


if __name__ == '__main__':
    p = multiprocessing.Process(target=func)
    p.start()
    print('主进程号', os.getpid())

